import React, { Component } from 'react';
import { HashRouter, Route, Redirect, Switch } from 'react-router-dom';
import Index from '../view/Index'
import Login from '../view/Login'
import Register from '../view/Register'
import Notfound from '../view/NotFound';
import Search from '../view/Search';
import Favlist from '../view/Favlist'
import Searchgood from '../view/Searchgood';
import Good from '../view/Goods'
class index extends Component {
    render() {
        return (
            <div>
                {/* <HashRouter> */}
                <Switch>
                    {/* {this.props.children} */}
                    {/* 模糊匹配路由  exact精确匹配路由 */}
                    <Route path='/index' component={Index}></Route>
                    <Route path='/login' component={Login}></Route>
                    <Route path='/register' component={Register}></Route>
                    <Route path='/search' component={Search}></Route>
                    <Route path='/searchgood' component={Searchgood}></Route>
                    <Route path='/favlist' component={Favlist}></Route>
                    <Route path='/goods' component={Good}></Route>
                    <Redirect from='/' to='/login' exact />
                    <Route path='*' component={Notfound}></Route>
                </Switch>
                {/* </HashRouter> */}
            </div>
        );
    }
}

export default index;